﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;

namespace WarFrota.Models
{
    [Table("Abastecimento")]
    public class Abastecimento
    {
        [Key]
        [Required]
        [DataType(DataType.Text)]
        public int Id { get; set; }

        [Required]
        [DataType(DataType.DateTime)]
        public DateTime Data { get; set; }

        [Required]
        public decimal Litros { get; set; }

        [Required]
        [DataType(DataType.Text)]
        [Display(Name = "Km Atual")]
        public decimal KmAtual { get; set; }

        [Display(Name = "Observação")]
        [DataType(DataType.MultilineText)]
        public string Observacao { get; set; }

        [Required]
        [Display(Name = "Placa(XXX-0000)")]
        [StringLength(8, ErrorMessage = "Placa de ter no mínimo 8 caracteres", MinimumLength = 8)]
        [ForeignKey("Veiculo")]
        public virtual string Placa { get; set; }

        public virtual Veiculo Veiculo { get; set; }

    }
}
